const express = require('express')
const router = express.Router()

// 中间件
const middleware = (req, res, next) => {
  console.log('middleware 处理中……')
  next()
}

// 注册路由中间件
router.use(middleware)

router.get('/get', (req, res) => {
  res.send('Hello world!')
})

router.post('/post', (req, res) => {
  res.send('Hello world!')
})

module.exports = router
